package com.study.Util;

import com.study.modules.saas.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;

public enum StateMachine {

    START{
        @Override
        public void change() {
            System.out.println(Injector.injectorMenuService);
        }
    },

    END{
        @Override
        public void change() {
        }
    };

    public abstract void change();

    public static class Injector{

        @Autowired
        private MenuService menuService;

        private static MenuService injectorMenuService;
        @PostConstruct
        public void init(){
            Injector.injectorMenuService = menuService;
        }
    }
}
